<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>
<script>
  function move({ x = 0, y = 0 } = {}) {
    return [x, y]
  }
  let a = move({ x: 1, y: 2 })
  console.log(a)
  let b = move({})
  console.log(b)
  let c = move({ x: 11 })
  console.log(c)
  let d = move({ y: 22 })
  console.log(d)

  let arr = [1, undefined, 3]
  // undefined就会出发默认参数机制
  let newArr = arr.map((x = 'test') => x)
  console.log(newArr)
</script>

</html>